import request from '/@/utils/request';

const deviceApi = {
	// 获取设备list
	getDeviceList(data: object) {
		return request({
			url: '/api/v1/smoke/device/page',
			method: 'post',
			data,
		});
	},

	// 获取设备list
	getDeviceInWs() {
		return request({
			url: '/api/v1/smoke/device/getAllDeviceInWs',
			method: 'post',
		});
	},

	// 新增
	add(data: object) {
		return request({
			url: '/api/v1/smoke/device',
			method: 'post',
			data,
		});
	},

	update(data: object) {
		return request({
			url: '/api/v1/smoke/device',
			method: 'put',
			data,
		});
	},

	delete(data: object) {
		return request({
			url: '/api/v1/smoke/device',
			method: 'delete',
			data,
		});
	},

	getBuildNum(data: object) {
		return request({
			url: '/api/v1/smoke/device/getBuildNum',
			method: 'post',
			data,
		});
	},

	getUnitNum(data: object) {
		return request({
			url: '/api/v1/smoke/device/getUnitNum',
			method: 'post',
			data,
		});
	},

	// 获取设备安装图片
	getInstallImg(data: object) {
		return request({
			url: '/api/v1/smoke/getInstallFile',
			method: 'get',
			params: data,
		});
	},

	// 获取设备 人工巡检日志
	getNormalCheckLog(data: object) {
		return request({
			url: '/api/v1/smoke/normalCheck/page',
			method: 'post',
			data: data,
		});
	},

	// 获取设备的人工巡检
	getLogDate(data: object) {
		return request({
			url: '/api/v1/smoke/normalCheck/logDate',
			method: 'post',
			data,
		});
	},

	//
	getDeviceCheckData(data: object) {
		return request({
			url: '/api/v1/smoke/normalCheck/logList',
			method: 'post',
			data,
		});
	},

	// 订阅设备报警
	subscribeAlarm(data: object) {
		return request({
			url: '/api/v1/smoke/device/subscribeAlarm',
			method: 'post',
			data,
		});
	},

	// 设备升级
	deviceUpgrade(data: object) {
		return request({
			url: '/api/v1/smoke/device/deviceUpgrade',
			method: 'post',
			data,
		});
	},

	// 设备重置
	deviceReboot(data: object) {
		return request({
			url: '/api/v1/smoke/device/deviceReboot',
			method: 'post',
			data,
		});
	},

	// 统计小区设备安装情况
	countForCommunity(data: object) {
		return request({
			url: '/api/v1/smoke/device/countForCommunity',
			method: 'post',
			data,
		});
	},

	// 生成安装文档
	createInstallDoc(data: object) {
		return request({
			url: '/api/v1/smoke/device/createInstallDoc',
			method: 'post',
			data,
		});
	},

	// 获取设备最新版本
	deviceNewVersion(data: object) {
		return request({
			url: '/api/v1/smoke/device/deviceNewVersion',
			method: 'post',
			data,
		});
	},

	getDeviceVersions() {
		return request({
			url: '/api/v1/smoke/device/getDeviceVersions',
			method: 'post',
		});
	},
};
export default deviceApi;
